package com.terry.test2.dp;

import cn.hutool.core.util.ObjectUtil;
import lombok.Data;
import lombok.Getter;

import javax.xml.bind.ValidationException;

/**
 * @author 小八
 * @date 2023年02月01日15:17
 */
@Data
public class UserId {
    @Getter
    private final Long userId;
    public UserId(Long userId) throws ValidationException {
        //1.可通过validation  @Empty实现
        if(ObjectUtil.isNull(userId)){
            throw new ValidationException("userId不能为空");
        }
        this.userId = userId;
    }
}
